package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.TransferAccountsDetailAddDTO;
import org.jsola.hr.dto.TransferAccountsDetailUpdateDTO;
import org.jsola.hr.query.TransferAccountsDetailQuery;
import org.jsola.hr.query.TransferBuildDetailQuery;
import org.jsola.hr.vo.TransferAccountsDetailImportAllVO;
import org.jsola.hr.vo.TransferAccountsDetailListVO;
import org.jsola.hr.vo.TransferAccountsDetailVO;
import org.springframework.core.io.Resource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 转账明细
 *
 * @author zhr
 */
@Api(tags = "hr-转账明细")
public interface ITransferAccountsDetailControllerAPI {

    /**
     * 新增转账明细
     * @param transferAccountsDetailAddDTO 转账明细新增实体
     * @return 转账明细展示对象
     */
    @ApiOperation(value = "新增转账明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailAddDTO", dataType = "TransferAccountsDetailAddDTO", value = "新增转账明细", paramType = "body")
    })
    Result<TransferAccountsDetailVO> save(TransferAccountsDetailAddDTO transferAccountsDetailAddDTO);


    /**
     * 修改转账明细
     * @param transferAccountsDetailUpdateDTO 转账明细
     * @return 更新数量
     */
    @ApiOperation(value = "修改转账明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailUpdateDTO", dataType = "TransferAccountsDetailUpdateDTO", value = "修改转账明细", paramType = "body")
    })
    Result<Integer> update(TransferAccountsDetailUpdateDTO transferAccountsDetailUpdateDTO);

    /**
     * 批量修改转账明细
     * @param transferAccountsDetailUpdateDTO 转账明细
     * @return 更新数量
     */
    @ApiOperation(value = "批量修改转账明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailUpdateDTO", dataType = "TransferAccountsDetailUpdateDTO", value = "修改转账明细", paramType = "body")
    })
    Result<Integer> updateBatch(TransferAccountsDetailUpdateDTO transferAccountsDetailUpdateDTO);





    /**
     * 删除单个转账明细，彻底删除
     * @param transferAccountsDetailId 转账明细id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个转账明细，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailId", dataType = "String", value = "转账明细id", paramType = "path")
    })
    Result<Integer> delete(String transferAccountsDetailId);


    /**
     * 批量删除转账明细，彻底删除
     * @param transferAccountsDetailIds 转账明细id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除转账明细，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailIds", dataType = "String[]", value = "转账明细id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] transferAccountsDetailIds);


    /**
     * 根据转账明细id查询转账明细详情
     * @param transferAccountsDetailId 转账明细id
     * @return 转账明细详情
     */
    @ApiOperation(value="根据转账明细id查询转账明细详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailId", dataType = "String", value = "转账明细id", paramType = "path")
    })
    Result<TransferAccountsDetailVO> findById(String transferAccountsDetailId);


    /**
     * 查询转账明细
     * @param transferAccountsDetailQuery 转账明细查询参数
     * @return page
     */
    @ApiOperation(value="查询转账明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailQuery", dataType = "TransferAccountsDetailQuery", value = "转账明细查询参数", paramType = "query")
    })
    Result<List<TransferAccountsDetailListVO>> listAll(TransferAccountsDetailQuery transferAccountsDetailQuery);


    /**
     * 根据查询条件  查询明细信息的idList
     * @param transferAccountsDetailQuery 查询条件
     * @return 转账明细id
     */
    @ApiOperation(value="根据查询条件  查询明细信息的idList")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailQuery", dataType = "TransferAccountsDetailQuery", value = "转账明细查询参数", paramType = "query")
    })
    Result<List<String>> selectIdsByBatchId(TransferAccountsDetailQuery transferAccountsDetailQuery);

     /**
     * 分页查询转账明细
     * @param transferAccountsDetailQuery 转账明细查询参数
     * @return page
     */
    @ApiOperation(value="分页查询转账明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailQuery", dataType = "TransferAccountsDetailQuery", value = "转账明细查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsDetailListVO>> page(TransferAccountsDetailQuery transferAccountsDetailQuery);

    /**
     * 根据参数  新增计薪人员
     * @param transferBuildDetailQuery 构造批次明细新增的 Query
     * @return 成功和失败的明细列表
     */
    @ApiOperation(value="根据参数  新增计薪人员")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferBuildDetailQuery", dataType = "TransferBuildDetailQuery", value = "构造批次明细新增的 Query", paramType = "body")
    })
    Result<TransferAccountsDetailImportAllVO> buildDetailAddDTOList(TransferBuildDetailQuery transferBuildDetailQuery);

    /**
     * 批量新增转账明细
     * @param transferAccountsDetailAddDTOList 新增转账明细List
     * @return 保存条数
     */
    @ApiOperation(value="批量新增转账明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailAddDTOList", dataType = "List<TransferAccountsDetailAddDTO>", value = "新增转账明细List", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> saveBatch(List<TransferAccountsDetailAddDTO> transferAccountsDetailAddDTOList);

    /**
     * 导出批次明细
     *
     * @param transferBuildDetailQuery 查询参数
     * @return excel
     */
    @ApiOperation(value = "导出批次明细")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferBuildDetailQuery", dataType = "TransferAccountsDetailQuery", value = "查询参数", paramType = "body")
    })
    ResponseEntity<Resource> export(TransferAccountsDetailQuery transferBuildDetailQuery);

    /**
     * 识别批次明细信息
     * @param file 待识别的文件
     * @param batchId 批次id（可以为空）
     * @param companyId 公司id
     * @param type 到账方式 1：支付宝 2：微信 3：银行
     * @return 批次明细Lst
     */
    @ApiOperation(value = "识别批次明细信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "file", dataType = "MultipartFile", value = "新增计薪人员：支付宝模板", paramType = "body"),
            @ApiImplicitParam(name = "batchId", dataType = "String", value = "批次id（可以为空）", paramType = "body"),
            @ApiImplicitParam(name = "companyId", dataType = "String", value = "公司id", paramType = "body"),
            @ApiImplicitParam(name = "type", dataType = "Integer", value = "到账方式 1：支付宝 2：微信 3：银行", paramType = "body")
    })
    Result<TransferAccountsDetailImportAllVO> recognitionDetailInfo(MultipartFile file, String batchId, String companyId, Integer type);

    /**
     * 导出识别的错误信息
     *
     * @param failTransferAccountsDetailAddDTOList 识别的错误数据
     * @param type 转账类型： 1 支付宝 2 微信 3 银行卡
     * @return excel
     */
    @ApiOperation(value = "导出识别的错误信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "failTransferAccountsDetailAddDTOList", dataType = "List<TransferAccountsDetailAddDTO>", value = "新增转账明细List", paramType = "body" ,allowMultiple = true),
            @ApiImplicitParam(name = "type", dataType = "Integer", value = "转账类型： 1 支付宝 2 微信 3 银行卡", paramType = "path")
    })
    ResponseEntity<Resource> exportFailTransferAccountsDetail(List<TransferAccountsDetailAddDTO> failTransferAccountsDetailAddDTOList,
                                                              Integer type);

    /**
     * 导出识别的错误信息(返回不需要登录的上传到服务器的文件下载地址)
     *
     * @param failTransferAccountsDetailAddDTOList 导出的数据List
     * @param type 到账方式 1：支付宝 2：微信 3：银行
     * @return excel地址
     */
    @ApiOperation(value = "导出识别的错误信息(返回不需要登录的上传到服务器的文件下载地址)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "failTransferAccountsDetailAddDTOList", dataType = "List<TransferAccountsDetailAddDTO>", value = "新增转账明细List", paramType = "body" ,allowMultiple = true),
            @ApiImplicitParam(name = "type", dataType = "Integer", value = "转账类型： 1 支付宝 2 微信 3 银行卡", paramType = "path")
    })
    Result<String> uploadFileNotLoginFailList(List<TransferAccountsDetailAddDTO> failTransferAccountsDetailAddDTOList,
                                            Integer type);


    /**
     * 分页查询转账明细(根据转账人员库id查询明细信息：不查询未支付的)
     * @param transferAccountsDetailQuery 转账人员库id 及分页信息
     * @return 转账明细列表信息
     */
    @ApiOperation(value = "分页查询转账明细(根据转账人员库id查询明细信息：不查询未支付的)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailQuery", dataType = "TransferAccountsDetailQuery", value = "转账明细查询参数", paramType = "query")
    })
    Result<Page<TransferAccountsDetailListVO>> selectPageByPeopleId(TransferAccountsDetailQuery transferAccountsDetailQuery);

    /**
     * 查询转账批次明细数据，导出未处理的异常信息
     *
     * @param transferBuildDetailQuery 查询参数
     * @return excel
     */
    @ApiOperation(value = "查询转账批次明细数据，导出未处理的异常信息")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferBuildDetailQuery", dataType = "TransferAccountsDetailQuery", value = "查询参数", paramType = "body")
    })
    ResponseEntity<Resource> selectExportErrorList(TransferAccountsDetailQuery transferBuildDetailQuery);

    /**
     * 批量修改转账明细（修改处理已处理专用）
     * @param transferAccountsDetailUpdateDTO 修改转账明细DTO
     * @return 更新数量
     */
    @ApiOperation(value = "批量修改转账明细（修改处理已处理专用）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "transferAccountsDetailUpdateDTO", dataType = "TransferAccountsDetailUpdateDTO", value = "修改转账明细", paramType = "body")
    })
    Result<Integer> updateBatchAndBatchInfo(TransferAccountsDetailUpdateDTO transferAccountsDetailUpdateDTO);



}

